<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<title>成员界面</title>
		<link rel="stylesheet" href="../css/mui.css">
		<link rel="stylesheet" href="../css/bootstrap.min.css">
		<script src="../js/mui.js"></script>
		<script src="../js/jquery.min.js"></script>
		<script src="../js/bootstrap.min.js"></script>
	</head>
	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">已签到成员</h1>
		</header>
		<div id="pullrefresh" class="mui-content mui-scroll-wrapper">
			<div class="mui-content">
				<ul class="mui-table-view" id="member">
					<!-- --------------------------数据填充--------------------------- -->
					<!-- <li class="mui-table-view-cell" name='1001'>张三 1001</li>
				<li class="mui-table-view-cell" name='1002'>李四 1002</li>
				<li class="mui-table-view-cell" name='1003'>王五 1003</li> -->
					<!-- --------------------------数据填充--------------------------- -->
				</ul>
			</div>
		</div>
		<script>
			//mui初始化
			mui.init({
				swipeBack: true, //启用右滑关闭功能
				gestureConfig: {
					tap: true, //默认为true
					doubletap: true, //默认为false
					longtap: true, //默认为false
					swipe: true, //默认为true
					drag: true, //默认为true
					hold: false, //默认为false，不监听
					release: false //默认为false，不监听
				},
				pullRefresh: {
					container: '#pullrefresh',
					down: {
						style: 'circle',
						callback: init
					}
				}
			});

			var cID;
			mui.plusReady(function() {
				cID = plus.webview.currentWebview().cID;
				init();
			});

			function init() {
				mui.ajax({
					url: 'http://120.27.247.180:8080/School/courseCipher/querySignedUser',
					type: "post",
					async: true,
					data: {
						"cID": cID,
					},
					dataType: "jsonp",
					contentType: "application/x-www-form-urlencoded; charset=utf-8",
					jsonp: "jsoncallback",
					success: function(data) {
						//console.log(data);
						data = JSON.parse(data);
						var memberEle = jQuery("#member");
						memberEle.empty();
						var memberInfo = data.nameList;
						for (var i = 0, l = memberInfo.length; i < l; i++) {
							memberEle.append("<li class='mui-table-view-cell'>" + memberInfo[i] + "</li>");
						}
						setTimeout(function() {
							mui('#pullrefresh').pullRefresh().endPulldownToRefresh();
						}, 1000);
					},
					error: function() {
						mui.toast("服务器异常，请稍后再试");
					}
				});
				
			}
		</script>
	</body>
</html>
